function OpenLiveHelp() {
    window.open('http://chat.ticketsnow.com/cgi-bin/start.exe/apps/livehelp/index.html?label=NOR', 'LHC_' + Math.floor(Math.random() * 100000), 'resizable,height=355,width=400');
}

function popup(pagelink, height, width, otheroptions) {
    var new_window = "height=" + height + ",width=" + width + otheroptions;
    win2 = window.open(pagelink, 'LHC_' + Math.floor(Math.random() * 100000), new_window);
}

function ChangeButtonImage(target, path) {
    target.src = path;
}

function ChangeButtonImageTab(target, path) {
    var currentTab = $get("ucTicketList_hiddenCurrSelectedTabImage");
    var staticImage = target.src;

    if (currentTab != null) {
        var currentTabSrc = currentTab.value.toString();
        if (currentTabSrc.toString() != target.src.toString())
            target.src = path;
        else
            target.src = staticImage;
    }
    else
        target.src = path;
}

function TooCloseToEventDatePopUp() {
    toggleCommonLayer("SellTicketsFiveDayRule", true);
}

function toggleCommonLayer(whichLayer, show) {
    if (document.getElementById) {
        // this is the way the standards work
        var style2 = document.getElementById(whichLayer).style;
        style2.display = show ? "inline" : "none";
        //style2.visibility = show? "visible":"hidden";
    }
    else if (document.all) {
        // this is the way old msie versions work
        var style2 = document.all[whichLayer].style;
        //style2.display = show? "":"block";
        style2.display = show ? "inline" : "none";
        //style2.visibility = show? "visible":"hidden";
    }
    else if (document.layers) {
        // this is the way nn4 works
        var style2 = document.layers[whichLayer].style;
        //style2.display = show? "":"block";
        style2.visibility = show ? "visible" : "hidden";
    }
}



function LoadinParent(url, closeSelf) {
    if (self.opener != null) {
        self.opener.location = url;
        if (closeSelf)
            self.close();
    }
    else {
        self.close();
    }
}

function CreateBookmarkLink(title, url) {
    if (window.sidebar && window.sidebar.addPanel) {//Mozilla FireFox BookMark
        window.sidebar.addPanel(title, url, "");
    }
    else if (window.external) {// IE favorite
        window.external.AddFavorite(location.href, document.title);
    }
    else if (window.open && window.print) {// Opera host
        return true;
    }
    else if (document.layers) {
        window.alert("Please click OK then press Ctrl + D to create a bokmark");
    }
    else {
        window.alert("Please use your browser\'s bookmarking facility to create a bookmark");
    }
}

function SetText(obj, value) {
    if (obj == null) {
        return;
    }
    if (obj.textContent != null)		// DOM 3 browser (new Mozilla)
        obj.textContent = value;
    else if (obj.nodeValue != null)	// DOM 2 browser (IE 5, IE6, old Mozilla, Opera 7, Safari 1,
        obj.nodeValue = value;
    else if (obj.innerText != null)	// Old browser (IE 4)
        obj.innerText = value;
}

function DisplayFlashObject(width, height, flashUrl, flashVars) {
    if ("https:" == document.location.protocol)
        return DisplaySecureFlashObject(width, height, flashUrl, flashVars);

    document.write('<object width="' + width + '" height="' + height + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">\n');
    document.write('<param name="movie" value="' + flashUrl + '">\n');
    document.write('<param name="quality" value="High">\n');
    document.write('<param name="flashvars" value="' + flashVars + '">\n');
    document.write('<param name="wmode" value="transparent">\n');
    document.write('<param name="allowScriptAccess" value="always">\n');
    document.write('<embed name wmode="transparent" src="' + flashUrl + '" allowScriptAccess="always" quality="High" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="' + flashVars + '"></embed>\n');
    document.write('</object>\n');
}

function DisplaySecureFlashObject(width, height, flashUrl, flashVars) {
    document.write('<object width="' + width + '" height="' + height + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">\n');
    document.write('<param name="movie" value="' + flashUrl + '">\n');
    document.write('<param name="quality" value="High">\n');
    document.write('<param name="flashvars" value="' + flashVars + '">\n')
    document.write('<param name="wmode" value="transparent">\n');
    document.write('<param name="allowScriptAccess" value="always">\n');
    document.write('<embed name wmode="transparent" src="' + flashUrl + '" allowScriptAccess="always" quality="High" type="application/x-shockwave-flash" width="' + width + '" height="' + height + '" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="' + flashVars + '"></embed>\n');
    document.write('</object>\n');
}


function PopUpWindowResize(Height, Width, URL) {

    window.open(URL, 'OFPopup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=' + Width + ',height=' + Height);

}

/***** PopUp Modal Routines******/

var PopUpModalAttributes = {
    shadow: true,
    shadowSize: 5,
    shadowColor: "#333333",
    backgroundColor: "#CCCCCC",
    borderColor: "#999999",
    titleBackColor: "#FFFFFF",
    titleFontColor: "#15428B",
    popupBackColor: "#FFFFFF",
    popupFontColor: "black",
    footerBackColor: "#FFFFFF",
    footerFontColor: "#15428B",
    okButtonText: "CLOSE",
    yesButtonText: "YES",
    noButtonText: "NO",
    cancelButtonText: "CANCEL",
    fontFamily: "Verdana,Arial",
    fontSize: "9pt"
}

var currentHeight;
var currentWidth;
var currentTop;
var currentLeft;

function makeLayer(id, layerVisible, layerParent) {
    var container = document.createElement("div");
    container.id = id;

    if (layerParent)
        layerParent.appendChild(container);
    else
        document.body.appendChild(container);

    return container;
}


function isIE() {
    return (window.ActiveXObject) ? true : false;
}


function getLayerWidth(id) {
    gw = document.getElementById(id).offsetWidth;
    return gw;
}

function getLayerHeight(id) {
    if (document.all) {
        gh = document.getElementById(id).offsetHeight;
    }
    else {
        gh = document.getElementById(id).offsetHeight;  //-5;
    }
    return gh;
}

function getFrameWidth() {
    var frameWidth = document.documentElement.clientWidth;
    if (self.innerWidth) {
        frameWidth = self.innerWidth;
    }
    else if (document.documentElement && document.documentElement.clientWidth) {
        frameWidth = document.documentElement.clientWidth;
    }
    else if (document.body) {
        frameWidth = document.body.clientWidth;
    }
    else return;
    return frameWidth;
}

function getFrameHeight() {
    var frameHeight = document.documentElement.clientHeight;
    if (self.innerWidth) {
        frameHeight = self.innerHeight;
    }
    else if (document.documentElement && document.documentElement.clientWidth) {
        frameHeight = document.documentElement.clientHeight;
    }
    else if (document.body) {
        frameHeight = document.body.clientHeight;
    }
    else return;
    return frameHeight;
}

function centerElement(elem, add, noleft) {
    var viewport = getViewportDimensions();
    var left = (viewport.width == 0) ? 50 : parseInt((viewport.width - elem.offsetWidth) / 2, 10);
    var top = (viewport.height == 0) ? 50 : parseInt((viewport.height - elem.offsetHeight) / 2, 10);
    var scroll = getScrollXY();
    //alert(scroll[1]);

    if (!noleft) {
        elem.style.left = (left + add) + 'px';
    }
    elem.style.top = (top + add + scroll[1]) + 'px';

    viewport, left, top, elem = null;
}

function getXmlHttp() {
    var xmlHttp;
    try {  // Firefox, Opera 8.0+, Safari  
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {  // Internet Explorer  
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            try {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch (e) {
                alert("Your browser does not support AJAX!");
                return false;
            }
        }
    }
    return xmlHttp;
}

function findControl(id, parent) {
    if (parent == null) {
        return document.all ? document.all[id] : document.getElementById(id);
    }
    else {
        return document.all ? document.all[id] : document.getElementById(id);
    }
}

function GetCustomControl(id) {
    return findControl(id);
}

function loadTextFile(id, allLayers, filename, height, width) {
    var objXml = getXmlHttp();
    objXml.open("GET", filename, true);
    objXml.onreadystatechange = function() {
        if (objXml.readyState == 4) {
            var txt = objXml.responseText;
            var html = "<div style='overflow-y: auto; overflow-x: auto; position:absolute; " +
                    "top:5px; left:5px; height:" + (height - 65) + "px; " +
                    "width:" + (width - 10) + "px;'>";
            html += txt;
            html += "</div>";
            GetCustomControl(id + "_popupBody").innerHTML = html;
            styleAllLayers(id, allLayers, "");
        }
    }
    objXml.send(null);
}

function getViewportDimensions() {
    var intH = 0, intW = 0;

    if (self.innerHeight) {
        intH = window.innerHeight;
        intW = window.innerWidth;
    }
    else {
        if (document.documentElement && document.documentElement.clientHeight) {
            intH = document.documentElement.clientHeight;
            intW = document.documentElement.clientWidth;
        }
        else {
            if (document.body) {
                intH = document.body.clientHeight;
                intW = document.body.clientWidth;
            }
        }
    }

    return {
        height: parseInt(intH, 10),
        width: parseInt(intW, 10)
    };
}

function getScrollXY() {
    var scrOfX = 0, scrOfY = 0;
    if (typeof (window.pageYOffset) == 'number') {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
    } else if (document.body && (document.body.scrollLeft || document.body.scrollTop)) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
    } else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop)) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
    }
    return [scrOfX, scrOfY];
}

function centerElement(elem, add, noleft) {
    var viewport = getViewportDimensions();
    var left = (viewport.width == 0) ? 50 : parseInt((viewport.width - elem.offsetWidth) / 2, 10);
    var top = (viewport.height == 0) ? 50 : parseInt((viewport.height - elem.offsetHeight) / 2, 10);
    var scroll = getScrollXY();
    //alert(scroll[1]);

    if (!noleft) {
        elem.style.left = (left + add) + 'px';
    }
    elem.style.top = (top + add + scroll[1]) + 'px';

    viewport, left, top, elem = null;
}

function modalPopupClose(id) {
    window.onresize = null;
    window.onscroll = null;

    document.body.removeChild(findControl(id + "_background"));
    document.body.removeChild(findControl(id + "_popup"));
    document.body.removeChild(findControl(id + "_shadow"));

    // IE6 crap
    toggleDropDowns("visible");

}


function styleAllLayers(id, allLayers, url) {
    var myLayers = allLayers;
    var oBackground = myLayers[0];
    var oPopup = myLayers[1];
    var oShadow = myLayers[2];
    var oPopupTitle = myLayers[3];
    var oPopupBody = myLayers[4];
    var oPopupFooter = myLayers[5];

    var zIndex = 20000;

    //Get Css parameters for borderColor. 
    var borderColor = PopUpModalAttributes.borderColor;

    //Default css for; oBackground, oPopup and oShadow layers
    //Position elements excluded (except for background); top, left, width, height. 
    //They will be calculated by contents of oPopup, or set by the parameters.
    var cssBackground = "display:inline; position:absolute; z-index: " + (zIndex) + "; left:0px; top:0px; filter:alpha(opacity=70); opacity:0.7;";
    var cssShadow = "display:inline; position:absolute; z-index: " + (zIndex + 1) + ";";
    var cssPopup = "display:inline; position:absolute; z-index: " + (zIndex + 2) + "; background-color:white; color:black; border:solid 1px " + borderColor + "; padding:1px;";

    //Get Css parameters for oBackGround layer.
    var backgroundColor = PopUpModalAttributes.backgroundColor;
    cssBackground += " background-color:" + backgroundColor + ";";

    //Css for oPopup content layers. (oPopupTitle, oPopupBody, oPopupFooter)
    var fontFamily = PopUpModalAttributes.fontFamily;
    var fontSize = PopUpModalAttributes.fontSize;
    var cssPopupTitle = "position: absolute; font-family:" + fontFamily + "; font-size:" + fontSize + "; padding: 5px; text-align:right;";
    var cssPopupBody = "position: absolute; font-family:" + fontFamily + "; font-size:" + fontSize + "; padding: 5px; text-align:left;";
    var cssPopupFooter = "position: absolute; font-family:" + fontFamily + "; font-size:" + fontSize + "; padding: 5px; text-align:right;";

    //First style the contents of the oPopup layer. (oPopupTitle, oPopupBody, oPopupFooter)
    //When this is done we can calculate the height and width of the oPopup contents.
    if (isIE) {
        oPopupTitle.style.cssText = cssPopupTitle;
        oPopupBody.style.cssText = cssPopupBody;
        oPopupFooter.style.cssText = cssPopupFooter;
    }
    else {
        oPopupTitle.setAttribute("style", cssPopupTitle);
        oPopupBody.setAttribute("style", cssPopupBody);
        oPopupFooter.setAttribute("style", cssPopupFooter);
    }

    //Get css color related parameters for; oPopup, oPopupTitle, oPopupBody, oPopupFooter.
    var titleBackColor = PopUpModalAttributes.titleBackColor;
    var titleFontColor = PopUpModalAttributes.titleFontColor;
    var popupBackColor = PopUpModalAttributes.popupBackColor;
    var popupFontColor = PopUpModalAttributes.popupFontColor;
    var footerBackColor = PopUpModalAttributes.footerBackColor;
    var footerFontColor = PopUpModalAttributes.footerFontColor;
    cssPopupTitle += " background-color:" + titleBackColor + ";";
    cssPopupTitle += " color:" + titleFontColor + ";";
    cssPopupBody += " background-color:" + popupBackColor + ";";
    cssPopupBody += " color:" + popupFontColor + ";";
    cssPopupFooter += " background-color:" + footerBackColor + ";";
    cssPopupFooter += " color:" + footerFontColor + ";";

    //Calculate maxWidth of the 3 layers in oPopup. (oPopupTitle,oPopupBody,oPopupFooter)
    var calcMaxWidth = 0;
    if (getLayerWidth(oPopupTitle.id) > calcMaxWidth)
        calcMaxWidth = getLayerWidth(oPopupTitle.id);
    if (getLayerWidth(oPopupBody.id) > calcMaxWidth)
        calcMaxWidth = getLayerWidth(oPopupBody.id);
    if (getLayerWidth(oPopupFooter.id) > calcMaxWidth)
        calcMaxWidth = getLayerWidth(oPopupFooter.id);

    //Calculate total height of the 3 layers in oPopup. (oPopupTitle+oPopupBody+oPopupFooter)
    var calcTotalHeight = getLayerHeight(oPopupTitle.id) + getLayerHeight(oPopupBody.id) + getLayerHeight(oPopupFooter.id);

    currentWidth = currentWidth != null ? currentWidth : (calcMaxWidth + 4); // Add 4px for; padding: 1px and border: 1px;
    currentHeight = currentHeight != null ? currentHeight : calcTotalHeight; // Set height as height of; oPopupTitle + oPopupBody + oPopupFooter
    //alert(" width : " + currentWidth + " height: " + currentHeight);

    var newBodyHeight = getLayerHeight(oPopupBody.id)
    if (currentHeight > calcTotalHeight) {
        // Sub 10px for; padding: 5px;
        newBodyHeight = currentHeight - getLayerHeight(oPopupTitle.id) - getLayerHeight(oPopupFooter.id);
        cssPopupBody += " height:" + newBodyHeight + "px;";
        calcTotalHeight = getLayerHeight(oPopupTitle.id) + newBodyHeight + getLayerHeight(oPopupFooter.id);
    }

    cssPopupTitle += " top:1px;";
    cssPopupBody += " top:" + getLayerHeight(oPopupTitle.id) + "px;";
    cssPopupFooter += " top:" + (getLayerHeight(oPopupTitle.id) + (newBodyHeight)) + "px;";
    cssPopupTitle += " width:" + (currentWidth - 10) + "px;"; // Sub 10px for; padding-left+right: 5px;
    cssPopupBody += " width:" + (currentWidth - 10) + "px;"; // Sub 10px for-left+right; padding: 5px;
    cssPopupFooter += " width:" + (currentWidth - 10) + "px;"; // Sub 10px for-left+right; padding: 5px;

    //Get browser width and height
    var frameWidth = getFrameWidth();
    var frameHeight = getFrameHeight();


    cssBackground += cssBackground + "width:" + frameWidth + "px;" + "height:" + frameHeight + "px;";
    //alert(cssBackground);

    if (currentHeight < calcTotalHeight)
        currentHeight = calcTotalHeight;

    //Get parameters for oPopup layer.
    currentTop = ((frameHeight / 2) - (currentHeight / 2));
    currentLeft = ((frameWidth / 2) - (currentWidth / 2));
    //alert(" top : " + currentTop + " left: " + currentLeft);

    cssPopupTitle += " left:1px;";
    cssPopupBody += " left:1px;";
    cssPopupFooter += " left:1px;";

    if (currentWidth)
        cssPopup += " width:" + currentWidth + "px;";
    else
        cssPopup += " width:" + maxWidth + "px;";

    if (currentHeight)
        cssPopup += " height:" + (currentHeight - 1) + "px;";
    else
        cssPopup += " height:" + (calcTotalHeight - 1) + "px;";

    //First style the contents of the oPopup layer. (oPopupTitle, oPopupBody, oPopupFooter)
    //When this is done we can calculate the height and width of the oPopup contents.
    if (isIE) {
        oPopupTitle.style.cssText = cssPopupTitle;
        oPopupBody.style.cssText = cssPopupBody;
        oPopupFooter.style.cssText = cssPopupFooter;
    }
    else {
        oPopupTitle.setAttribute("style", cssPopupTitle);
        oPopupBody.setAttribute("style", cssPopupBody);
        oPopupFooter.setAttribute("style", cssPopupFooter);
    }

    //Setup shadow layer
    var shadow = PopUpModalAttributes.shadow;
    var shadowSize = PopUpModalAttributes.shadowSize;
    if (shadow) {
        //Get parameters for oShadow layer.
        shadowSize = PopUpModalAttributes.shadowSize;
        shadowColor = PopUpModalAttributes.shadowColor;
        cssShadow += "background-color:" + shadowColor + ";";

        //cssShadow += " top:" + (parameters.top + parameters.shadowSize) + "px;";
        //cssShadow += " left:" + (parameters.left + parameters.shadowSize) + "px;";
        if (currentWidth)
            cssShadow += " width:" + currentWidth + "px;";
        else
            cssShadow += " width:" + maxWidth + "px;";
        if (currentHeight)
            cssShadow += " height:" + (currentHeight - 1) + "px;";
        else
            cssShadow += " height:" + (calcTotalHeight) + "px;";

    }
    else {
        cssShadow += " display:none;";
    }

    //Secondly style the contents of the main layers. (oBackGround, oPopup, oShadow)
    if (isIE) {
        oPopup.style.cssText = cssPopup;
        oShadow.style.cssText = cssShadow;
        oBackground.style.cssText = cssBackground;
    }
    else {
        oPopup.setAttribute("style", cssPopup);
        oShadow.setAttribute("style", cssShadow);
        oBackground.setAttribute("style", cssBackground);
    }

    centerElement(document.getElementById(id + '_background'), 0, true);
    centerElement(document.getElementById(id + '_popup'), 0, false);
    if (shadow)
        centerElement(document.getElementById(id + '_shadow'), shadowSize, false);

    if (url != "")
        loadTextFile(id, allLayers, url, currentHeight, currentWidth);

    window.onresize = function() {
        centerElement(document.getElementById(id + '_background'), 0, true);
        centerElement(document.getElementById(id + '_popup'), 0, false);
        if (shadow) {
            centerElement(document.getElementById(id + '_shadow'), shadowSize, false);
        }
    }

    window.onscroll = function() {
        centerElement(document.getElementById(id + '_background'), 0, true);
        centerElement(document.getElementById(id + '_popup'), 0, false);
        if (shadow) {
            centerElement(document.getElementById(id + '_shadow'), shadowSize, false);
        }
    }

    //}
}

function createAllLayers(id) {
    //Create all 6 layers for; BackGround, Popup, Shadow, PopupTitle, PopupBody, PopupFooter
    var oBackground = makeLayer(id + '_background', true, null);        // 0
    var oPopup = makeLayer(id + '_popup', true, null);                  // 1
    var oShadow = makeLayer(id + '_shadow', true, null);                // 2
    var oPopupTitle = makeLayer(id + '_popupTitle', true, oPopup);      // 3
    var oPopupBody = makeLayer(id + '_popupBody', true, oPopup);        // 4
    var oPopupFooter = makeLayer(id + '_popupFooter', true, oPopup);    // 5

    //Set default values for button related parameters; OK, Yes, No, Cancel
    var okButtonText = PopUpModalAttributes.okButtonText;
    var yesButtonText = PopUpModalAttributes.yesButtonText;
    var noButtonText = PopUpModalAttributes.noButtonText;
    var cancelButtonText = PopUpModalAttributes.cancelButtonText;
    var onOk = "modalPopupClose(\"" + id + "\");";
    var onYes = "modalPopupClose(\"" + id + "\");";
    var onNo = "modalPopupClose(\"" + id + "\");";
    var onCancel = "modalPopupClose(\"" + id + "\");";

    //Create popup 'title' layer
    oPopupTitle.innerHTML = "";

    //Split buttons parameter and create buttons; OK, Yes, No, Cancel
    var fontFamily = PopUpModalAttributes.fontFamily;
    var buttons = "ok";
    var bt = buttons.split(',');
    for (x in bt) {
        if (bt[x] == "ok")
            oPopupTitle.innerHTML += "<input name='" + id + "_okButton' id='" + id + "_okButton' type=button value='" + okButtonText + "' style='font-family:Verdana,Arial; font-size:8pt; border: solid 1px #859DBE; background-color: white; width:75px; height:20px; margin-right: 5px; margin-left: 5px;' onclick='" + onOk + "'/>";
        if (bt[x] == "yes")
            oPopupTitle.innerHTML += "<input name='" + id + "_yesButton' id='" + id + "_yesButton' type=button value='" + yesButtonText + "' style='font-family:Verdana,Arial; font-size:8pt; border: solid 1px #859DBE; background-color: white; width:75px; height:20px; margin-right: 5px; margin-left: 5px;' onclick='" + onYes + "'/>";
        if (bt[x] == "no")
            oPopupTitle.innerHTML += "<input name='" + id + "_noButton' id='" + id + "_noButton' type=button value='" + noButtonText + "' style='font-family:Verdana,Arial; font-size:8pt; border: solid 1px #859DBE; background-color: white; width:75px; height:20px; margin-right: 5px; margin-left: 5px;' onclick='" + onNo + "'/>";
        if (bt[x] == "cancel")
            oPopupTitle.innerHTML += "<input name='" + id + "_cancelButton' id='" + id + "_cancelButton' type=button value='" + cancelButtonText + "' style='font-family:Verdana,Arial; font-size:8pt; border: solid 1px #859DBE; background-color: white; width:75px; height:20px; margin-right: 5px; margin-left: 5px;' onclick='" + onCancel + "'/>";
    }

    //Create popup 'footer' layer
    oPopupFooter.innerHTML = "";

    //Create popup 'body' layer, is done in; Alert, Confirm, YesNoCancel, Prompt and Custom functions.
    var allLayers = new Array(oBackground, oPopup, oShadow, oPopupTitle, oPopupBody, oPopupFooter);

    return allLayers;
}


function PopUpModalHowTo(Height, Width, URL) {

    // IE6 crap
    toggleDropDowns("hidden");

    var id = 'modAlert'
    var myLayers = createAllLayers(id);
    var oPopupBody = myLayers[4];
    currentHeight = Height;
    currentWidth = Width;

    // Custom style attributes for HowTo
    PopUpModalAttributes.titleBackColor = "black";
    PopUpModalAttributes.titleFontColor = "white";
    PopUpModalAttributes.popupBackColor = "black";
    PopUpModalAttributes.popupFontColor = "white";
    PopUpModalAttributes.footerBackColor = "black";
    PopUpModalAttributes.footerFontColor = "white";
    PopUpModalAttributes.borderColor = "black";

    styleAllLayers(id, myLayers, URL);

}


function PopUpModal(Height, Width, URL) {
    //window.open(URL, 'OFPopup', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=' + Width + ',height=' + Height);

    // IE6 crap
    toggleDropDowns("hidden");

    var id = 'modAlert'
    var myLayers = createAllLayers(id);
    var oPopupBody = myLayers[4];
    currentHeight = Height;
    currentWidth = Width;
    styleAllLayers(id, myLayers, URL);


}

function msieversion() {
    var ua = window.navigator.userAgent
    var msie = ua.indexOf("MSIE ")

    if (msie > 0)      // If Internet Explorer, return version number
        return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)))
    else                 // If another browser, return 0
        return 0

}

function toggleDropDowns(selectmode) {
    toggleSelect(selectmode, "ctl00_PlaceHolder_CenterContent_ShippingAddress_countries");
    toggleSelect(selectmode, "ctl00_PlaceHolder_CenterContent_ShippingAddress_stateRegions");
    toggleSelect(selectmode, "ctl00_PlaceHolder_CenterContent_BillingAddress1_countries");
    toggleSelect(selectmode, "ctl00_PlaceHolder_CenterContent_BillingAddress1_stateRegions");
    toggleSelect(selectmode, "ctl00_PlaceHolder_CenterContent_CreditCard1_creditCards");
    toggleSelect(selectmode, "ctl00_PlaceHolder_CenterContent_CreditCard1_Month");
    toggleSelect(selectmode, "ctl00_PlaceHolder_CenterContent_CreditCard1_Year");
    toggleSelect(selectmode, "ctl00_PlaceHolder_CenterContent_OrderSummary_ddlQuantity");
}

function toggleSelect(selectmode, elementid) {
    elemForm = document.getElementById(elementid);
    if ((msieversion() == 6) && elemForm) {
        elemForm.style.visibility = selectmode;
    }

}